package com.ruoyi.finance.collection.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.finance.collection.domain.VBillCollection;
import com.ruoyi.finance.collection.service.VBillCollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 针对视图【V_BILL_COLLECTION】的数据库操作Controller
 *
 * @author 毕京瑞
 * @createTime 2023-07-04 14:05
 */
@RestController
@RequestMapping("/finance/vBillCollection")
public class VBillCollectionController extends BaseController {
	
	@Autowired
	private VBillCollectionService vBillCollectionService;
	
	
	/**
	 * 根据参数获取【V_BILL_COLLECTION】列表
	 *
	 * @param vBillCollection
	 * @return
	 */
	@GetMapping("/list")
	public TableDataInfo list(VBillCollection vBillCollection) {
		startPage();
		List<VBillCollection> list = vBillCollectionService.listByParams(vBillCollection);
		return getDataTable(list);
	}
	
	/**
	 * 根据项目ids获取【V_BILL_COLLECTION】列表
	 *
	 * @param projectIds
	 * @return
	 */
	@PostMapping("/listVBillCollectionByProjectIds")
	public AjaxResult listVBillCollectionByProjectIds(@RequestBody List<String> projectIds) {
		List<VBillCollection> list = vBillCollectionService.listVBillCollectionByProjectIds(projectIds);
		return AjaxResult.success(list);
	}
	
	
	/**
	 * 根据id获取【V_BILL_COLLECTION】详细信息
	 *
	 * @param id
	 * @return
	 */
	@GetMapping(value = "/{id}")
	public AjaxResult getInfo(@PathVariable String id) {
		return AjaxResult.success(vBillCollectionService.getById(id));
	}
	
	
	/**
	 * 新增【V_BILL_COLLECTION】
	 */
	@PostMapping
	@Log(title = "V_BILL_COLLECTION新增费项", businessType = BusinessType.INSERT)
	public AjaxResult add(@Validated @RequestBody VBillCollection vBillCollection) {
		return null;
	}
	
	/**
	 * 修改【V_BILL_COLLECTION】
	 */
	@PutMapping
	@Log(title = "V_BILL_COLLECTION修改费项", businessType = BusinessType.UPDATE)
	public AjaxResult edit(@Validated @RequestBody VBillCollection vBillCollection) {
		return null;
		
	}
	
	/**
	 * 删除【V_BILL_COLLECTION】
	 */
	@DeleteMapping("/{ids}")
	@Log(title = "V_BILL_COLLECTION删除费项", businessType = BusinessType.DELETE)
	public AjaxResult remove(@PathVariable Long[] ids) {
		return null;
	}
	
	
}
